﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <style type="text/css">
        div {
            width: 100%;
        }
    </style>
    <script src="~/Content/js/jquery-1.8.2.js"></script>
    <script src="~/Content/js/tjzheng.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/Content/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
    <div>
        <h1>完整demo</h1>
        <form id="form">
            @Html.Ueditor(3,"content","<p>Ueditor</p>")
            @*<script id="editor" type="text/plain" name="content" type="text/plain" style="width: 1024px; height: 500px;"></script>*@
            <input type="button" id="btn_submit" value="提交" />
        </form>
    </div>
    <script type="text/javascript">
        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        //var ue = UE.getEditor('editor');
        //ue.ready(function () {
        //    ue.execCommand('serverparam', {
        //        'ULId': '3',
        //        'CategoryCode': 'Ueditor',
        //        'LimitCode': 'Images',
        //    });
        //    ue.setContent("<p>qqq</p>");
        //});
        $("#btn_submit").click(function () {
            var objFormEntity = new FormEntity("#form");
            objFormEntity.submitSuccess = function (data) {
                alert(data);
            };
            objFormEntity.isClearData = false;
            objFormEntity.url = "/ue/postdata";
            objFormEntity.submit();
        });
    </script>
</body>
</html>
